import { Component, OnInit, ViewChild, Input } from '@angular/core';
import { LbZskcxComponent } from '../lb_zskcx/lb_zskcx.component';
import { HttpService } from 'lbf';


@Component({
  selector: 'lb-yjs',
  templateUrl: './lb_yjs.html',
  styleUrls: ['./lb_yjs.less'],
})
export class YjsComponent implements OnInit {
  _dad017 = 0;
  _dad011 = 0;
  zsxList = [];
  zskcxTcVisible = false;
  zskcxTcDad017 = {};
  temp = false;
  titleText = '';
  @ViewChild('zskcxTc', { static: false }) zskcx: LbZskcxComponent;
  @Input() set DAD017(value:number) {
    this._dad017 = value
    this.initZsxData();    
  }
  get DAD017() {
    return this._dad017
  }

  @Input() set DAD011(value:number) {
    this._dad011 = value
  }
  get DAD011() {
    return this._dad011
  }
  
  initZsxData() {
    this.lbservice
      .lbservice('ZSKWH_QSXZSX', { para: { DAD017: this._dad017 } })
      .then(resdata => {
        if (resdata.code > 0) {
          this.zsxList = resdata.message.list;
        } else {
          console.log(resdata.errmsg);
        }
      });
  }

  showZskcxTc(dataDad017:number,dataDad031:string) {
    this.zskcxTcDad017 = dataDad017;
    this.titleText = dataDad031;
    this.zskcxTcVisible = true;
    this.zskcx.refresh(this.zskcxTcDad017);
    this.zskcx.ShowLeft = true;
  }
  zskcxTcCancel() {
    this.zskcxTcVisible = false;
    this.zskcxTcDad017 = undefined;
  }
  constructor(
    private lbservice: HttpService,
    
  ) {
    
  }

  ngOnInit() {
    
  }


}